package com.example.myapplication3;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class RateListSaveActivity extends AppCompatActivity {

    private static final String TAG ="RateListSaveActivity" ;
    TextView tw1;
    TextView tw2;
    EditText ed;
    Float rate;
    Float result;
    private TextView name;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rate_list_save);
        String title2=getIntent().getStringExtra("titlestr");
        String detail2=getIntent().getStringExtra("detailstr");
        rate=Float.parseFloat(detail2);
        tw1=(TextView)findViewById(R.id.textView3);
        tw2=(TextView)findViewById(R.id.textView4);
        ed=findViewById(R.id.editTextTextPersonName);
        tw1.setText(title2);
        tw2.setText(detail2);
    }
    private void show(){
        ed.setText(String.valueOf(result));
    }
    public void count(View v){
        Float rmb=Float.parseFloat(ed.getText().toString());
        result=100/rmb*rate;
        show();
    }
    }
